package com.helloniu.red5.info;

import org.red5.io.amf3.ByteArray;

public class UserInfo {
    public String userName = null;
    public String userID = null;
    public BussinessInfo binfo = new BussinessInfo();    
    public int role = 0;
    public UserInfo() {
    	
    }
    
    public UserInfo(String uid) {
    	userID = uid;
    }

    public void writeData(ByteArray barr) {
    	barr.writeUTF(userID);
    	binfo.writeData(barr);
    	
    }
    
    public String toString() {
        return "[" + userID + ":" + role +":" + binfo+"]";        
    }

    public boolean equals(Object uinfo) {
        if(uinfo instanceof UserInfo) {
            return userID.equals(((UserInfo) uinfo).userID);
        }

        return false;
    }
}
